import { RouteRecordRaw } from "vue-router";

const asyncComponents = () => {
    return {
        HomeView: () => import('../views/HomeView.vue'),
        ErrorPage: () => import('../views/404.vue')
    }
}

const staticRoutes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/home',
    },
    {
        path: '/home',
        name: 'Home',
        component: asyncComponents().HomeView,
        meta: { title: '主页', roles: ['visitor', 'user', 'admin'], icon: 'home', imgUrl: '' }

    },
    {
        path: '/errorPage',
        name: 'ErrorPage',
        component: asyncComponents().ErrorPage,
        meta: { title: '404', roles: ['visitor', 'user', 'admin'] }
    },
    {
        path:'/test',
        name:'Test',
        component:()=>import('@/component/shared/Test.vue'),
    }
]

export default staticRoutes